$def with (books=None, books_wo_isbns=None)

<div class="my-imports">

  $if not books:
    <div class="import-export">
      <div class="import-export__section">
        <h3>$_("Import from Goodreads")</h3>
        <p>$:_('For instructions on exporting data refer to: <a href="https://www.goodreads.com/review/import">Goodreads Import/Export</a>')</p>
        <form method="POST" action="/account/import/goodreads"
            enctype="multipart/form-data" class="olform olform--decoration">
          <div>
            <input required type="file" name="csv" />
            <br>$_("File size limit 10MB and .csv file type only")
          </div>
          <div>
            <input class="cta-btn cta-btn--available cta-btn--small"
                type="submit" value="$_('Load Books')" data-ol-link-track="PatronImports|Goodreads">
          </div>
        </form>
      </div>
      <div class="import-export__section">
        <h3>$_("Export your Reading Log")</h3>
        <p>$_("Download a copy of your reading log.") <a href="/help/faq/reading-log.en#reading-log">$_("What is this?")</a></p>
        <form method="GET" action="/account/export"
            enctype="multipart/form-data" class="olform olform--decoration">
          <input type="hidden" name="type" value="reading_log">
          <div>
            <input type="submit" class="cta-btn cta-btn--available cta-btn--small" value="$_('Download (.csv format)')" data-ol-link-track="PatronExports|ReadingLog">
          </div>
        </form>
      </div>
      <div class="import-export__section">
        <h3>$_("Export your book notes")</h3>
        <p>$_("Download a copy of your book notes.") <a href="/help/faq/book-notes">$_("What are book notes?")</a></p>
        <form method="GET" action="/account/export"
            enctype="multipart/form-data" class="olform olform--decoration">
          <input type="hidden" name="type" value="book_notes">
          <div>
            <input type="submit" class="cta-btn cta-btn--available cta-btn--small" value="$_('Download (.csv format)')" data-ol-link-track="PatronExports|BookNotes">
          </div>
        </form>
      </div>
      <div class="import-export__section">
        <h3>$_("Export your reviews")</h3>
        <p>$_("Download a copy of your review tags.") <a href="/help/faq/reviews#book-tags">$_("What are review tags?")</a></p>
        <form method="GET" action="/account/export"
            enctype="multipart/form-data" class="olform olform--decoration">
          <input type="hidden" name="type" value="reviews">
          <div>
            <input type="submit" class="cta-btn cta-btn--available cta-btn--small" value="$_('Download (.csv format)')" data-ol-link-track="PatronExports|ReviewTags">
          </div>
        </form>
      </div>
      <div class="import-export__section">
        <h3>$_("Export your list overview")</h3>
        <p>$_("Download a summary of your lists and their contents.") <a href="/help/faq/reading-log.en#lists">$_("What are lists?")</a></p>
        <form method="GET" action="/account/export"
            enctype="multipart/form-data" class="olform olform--decoration">
          <input type="hidden" name="type" value="lists">
          <div>
            <input type="submit" class="cta-btn cta-btn--available cta-btn--small" value="$_('Download (.csv format)')" data-ol-link-track="PatronExports|ListsSummary">
          </div>
        </form>
      </div>
      <div class="import-export__section">
        <h3>$_("Export your star ratings")</h3>
        <p>$_("Download a copy of your star ratings.") <a href="/help/faq/reviews#star-ratings">$_("What are star ratings?")</a></p>
        <form method="GET" action="/account/export"
            enctype="multipart/form-data" class="olform olform--decoration">
          <input type="hidden" name="type" value="ratings">
          <div>
            <input type="submit" class="cta-btn cta-btn--available cta-btn--small" value="$_('Download (.csv format)')" data-ol-link-track="PatronExports|StarRatings">
          </div>
        </form>
      </div>
    </div>

  $else:
    <div class="import-buttons">
      <div id="myProgress" class="hidden">
        <div id="myBar">$_("Importing...")</div>
      </div>
      <div>
        <button class="hidden cta-btn cta-btn--available cta-btn--small cancel-button"
          onclick="window.location.reload();" >Cancel</button>
      </div>
    </div>

    <input type="submit" class="import-submit cta-btn cta-btn--unavailable" value="Import $len(books) Books">
    $ keys = ['ISBN', 'Title', 'My Rating', 'Exclusive Shelf', 'Date Read']
    <div class="div-class">
      <table class="import-table">
        <thead>
          <tr>
            <th scope="col" class="toggle-all">
              <input type="checkbox" checked="checked">
            </th>
            $for key in keys:
              <th scope="col">$key</th>
            <th scope="col" class="import-status hidden">
              $_("Status")
            </th>
            <th scope="col" class="status-reason hidden">
              $_("Reason")
            </th>
          </tr>
        </thead>
        <tbody>
          $for isbn in books:
            <tr class="table-row" isbn="$isbn">
              <td>
              $ dict = {'ISBN':'', 'Title':'', 'My Rating':'', 'Exclusive Shelf':'', 'Date Read':''}
              $ k = ['ISBN', 'My Rating', 'Exclusive Shelf', 'Date Read']
              $for key in k:
                  $ dict[key] = books[isbn].get(key)
              <input class="add-book" value="$(dict)" type="checkbox" checked="checked">
              </td>
              $for key in keys:
                <td>$books[isbn].get(key)</td>
            </tr>
          $for id in books_wo_isbns:
            <tr>
              <td>
              </td>
              $for key in keys:
                <td>
                  $if books_wo_isbns[id].get(key) != '=""':
                    $books_wo_isbns[id].get(key)
                </td>
              <td class="books-wo-isbn hidden error-imported">$_("Error")</td>
              <td class="books-wo-isbn hidden error-imported">$_("No ISBN")</td>
            </tr>
        </tbody>
      </table>
    </div>
</div>
